<?php

namespace common\models;

use Yii;
use himiklab\sitemap\behaviors\SitemapBehavior;
use yii\helpers\Url;
/**
 * This is the model class for table "shicai".
 *
 * @property integer $id
 * @property integer $type_id
 * @property string $title
 * @property string $desc
 * @property string $keywords
 * @property string $content
 * @property string $url
 * @property integer $created_at
 */
class Shicai extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'shicai';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['type_id', 'created_at'], 'integer'],
            [['content'], 'string'],
            [['title'], 'string', 'max' => 100],
            [['desc', 'keywords', 'url'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('common', 'ID'),
            'type_id' => Yii::t('common', 'Type ID'),
            'title' => Yii::t('common', 'Title'),
            'desc' => Yii::t('common', 'Desc'),
            'keywords' => Yii::t('common', 'Keywords'),
            'content' => Yii::t('common', 'Content'),
            'url' => Yii::t('common', 'Url'),
            'created_at' => Yii::t('common', 'Created At'),
        ];
    }
    /**
     * 设置自动更新时间   created_at | updated_at 字段类型为 int(11) 
     */
    public function behaviors() {
        return [
            \yii\behaviors\TimestampBehavior::className(),
        ];
    }    
}
